/*
 * Engine.h
 *
 *  Created on: 21/02/2009
 *      Author: FSeixas
 */
#include<iostream>
#include<string>
#include<vector>

using namespace std;

#ifndef ENGINE_H_
#define ENGINE_H_

enum EngineStateEnum
{
	NOT_STARTED, // GUI didn't send uci
	STARTED, // GUI sent uci and the engine answered with identification
	SETTING_OPTIONS, // GUI is sendind options configs
	OPTIONS_SETTED, // GUI sent an uciok
	INITIALIZING, // GUI sent parameters and an isready
	INITIALIZED, // Engine defined all those parameters and sent an readyok back to GUI
	WAITING, // Engine is waiting for GUI move commands
	SEARCHING, // Engine is searching for the best move
	SEARCH_FINISHED // Engine found the best move or received a stop command
};

class Engine {
private:
	EngineStateEnum _currentState;
	vector<string> _tokens;
	short count;
public:
	Engine();
	virtual ~Engine();
	void ReadCommand(const string& command);
	void PrintCurrentCommands();
	void ProcessCommand();
	void PrintCommand(const string& command);
};

#endif /* ENGINE_H_ */
